<?php
/**
 * Created by PhpStorm.
 * Admininfo: Administrator
 * Date: 2018/3/21
 * Time: 19:28
 */
namespace app\home\controller;
use app\common\controller\Basehome;
use app\admin\model\Article as Articlemodel;
class  Article extends Basehome{
    public  function detial(){
        $Articlemodel=new Articlemodel();
        $info=$Articlemodel->find(input('id'));
        if($info){
            $Articlemodel->where('id',input('id'))->setInc('hits'); // 用户的积分加1
            $this->assign('info',$info->toArray());
            return $this->fetch();
         }else{
            return $this->fetch('Index/index');
        }

    }
}